package com.itheima.edu.day22Thread;

public class Desk {
/*
    //定义桌子的状态，true代表有汉堡包
    //             false代表没有汉堡包
    public static boolean flag = false;

    //定义共享数据的大小
    public static int count = 10;

    //定以一个对象锁
    public static final Object lock = new Object();*/

    private boolean flag;
    private int count;
    private final Object lock = new Object();

    public Desk() {
    }

    public Desk(boolean flag, int count) {
        this.flag = flag;
        this.count = count;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Object getLock() {
        return lock;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "flag=" + flag +
                ", count=" + count +
                ", lock=" + lock +
                '}';
    }
}
